package com.ease.model.type;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author nathanleewei
 * 
 */
public class GeoPolygon implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -9084152969874415210L;

	private List<GeoPoint> geoPoints;

	public GeoPolygon addGeoPoint(GeoPoint geoPoint) {
		if (null != geoPoint) {
			if (null == geoPoints) {
				geoPoints = new ArrayList<GeoPoint>();// new
				// LinkedList<GeoPoint>
			}
			geoPoints.add(geoPoint);
		}
		return this;
	}

	/**
	 * @param geoPoints
	 *            the geoPoints to set
	 */
	public void setGeoPoints(List<GeoPoint> geoPoints) {
		this.geoPoints = geoPoints;
	}

	/**
	 * @return the geoPoints
	 */
	public List<GeoPoint> getGeoPoints() {
		return geoPoints;
	}

	public void addGeoPoint(double longitude, double latitude, double altitude) {

		GeoPoint geoPoint = new GeoPoint(longitude, latitude, altitude);

		addGeoPoint(geoPoint);
	}

	public void addGeoPoint(double longitude, double latitude) {

		GeoPoint geoPoint = new GeoPoint(longitude, latitude, 0);

		addGeoPoint(geoPoint);
	}
}
